<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Qihuo extends CI_Controller {
	
	function __construct(){
		parent::__construct();
	}
	
	//股指期货
	//20150814
	public function zhs_qihuo(){
		if($_POST){
			if($this->session->userdata('rsh_user') == false){//如果未登录就跳到登录页面
				echo '请先登录';
				return;
			}			
			$user = $this->session->userdata('rsh_user');
			$this->load->model('qihuo_model');
			$this->load->model('account_model');
			$res_acc=$this->account_model->get_account($user['user_id']);
			if($res_acc['use_money']<$_POST['money']){
				$reMsg='您的余额不足，请先充值';
				return;
			}
			$data['userid']=$user['user_id'];
			$data['ftype']=1;//类型
			$data['money']=$_POST['money'];
			$data['is_check']=0;//是否审核
			$data['addtime']=time();
			$data['remark']='';//备注
			$res=$this->qihuo_model->add($data);			
			if($res==1){
				echo '申请成功，请等待审核';
			}else{
				echo '申请失败，请联系客服';
			}			
			return;
		}

		$this->load->view('qihuo/zhs_qihuo');
	}

	//股指期货合作协议
	//20150816
	function zhs_qihuo_contract(){
		$this->load->view('qihuo/zhs_qihuo_contract');
	}
	
	//股指期货介绍
	//20150828
	public function zhs_qihuo_introduce(){
		$this->load->view('qihuo/zhs_qihuo_introduce');
	}

	//股指期货交易规则
	//20150828
	public function zhs_qihuo_rule(){
		$this->load->view('qihuo/zhs_qihuo_rule');
	}

	//股指期货交易步骤
	//20150828
	public function zhs_qihuo_step(){
		$this->load->view('qihuo/zhs_qihuo_step');
	}
}